<?php
declare (strict_types = 1);

namespace app\listener;

use think\swoole\Websocket;

class SwooleWebsocket
{

    public $websocket = null;

    public function __construct(Websocket $websocket)
    {
        $this->websocket = $websocket;
    }

    /**
     * 事件监听处理
     *
     * @return mixed
     */
    public function handle($event)
    {
        $this->websocket->emit("testcallback", ['aaaaa' => 1]);
    }
}
